java program to calculate sum of first N natural numbers